import java.util.Arrays;
import java.util.Scanner;

public class demo01 {
    //100449-组队竞赛
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=n*3;
        long[] arr=new long[m];
        for (int i = 0; i < m; i++) {
            arr[i]=sc.nextLong();
        }
        Arrays.sort(arr);
        long[] num=new long[m-n];
        for (int i = n; i < m; i++) {
            num[i-n]=arr[i];
        }
        long sum=0;
        for (int i = 0; i < num.length; i+=2) {
            sum+=num[i];
        }
        System.out.println(sum);
    }
}

